<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('商城订单列表')" />
</head>
<body class="gray-bg">
<div class="container-div">
    <div class="row">
        <div class="col-sm-12 search-collapse">
            <form id="formId">
                <div class="select-list">
                    <ul>
                        <li class="hidden">
                            <label>删除状态：</label>
                            <input type="text" name="deleted" value="N"/>
                        </li>
                        <!--<li>
                            <label>用户昵称：</label>
                            <input type="text" name="nickname"/>
                        </li>-->
                        <li>
                            <label>订单号：</label>
                            <input type="text" name="orderNo"/>
                        </li>
                        <li>
                            <label>支付号：</label>
                            <input type="text" name="payNo"/>
                        </li>

                        <li>
                            <label>订单状态：</label>
                            <select name="orderStatus" th:with="type=${@dict.getType('mall_order_status')}">
                                <option value="">所有</option>
                                <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                            </select>
                        </li>
                        <li>
                            <label>下单时间：</label>
                            <input type="text" class="time-input" id="startTime" placeholder="开始时间" name="params[beginTime]"/>
                            <span>-</span>
                            <input type="text" class="time-input" id="endTime" placeholder="结束时间" name="params[endTime]"/>
                        </li>
                        <!--<li>
                            <label>支付状态：</label>
                            <select name="payStatus" th:with="type=${@dict.getType('number_yesno')}">
                                <option value="">所有</option>
                                <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                            </select>
                        </li>-->
                        <!--<li>
                            <label>退款状态：</label>
                            <select name="returnStatus" th:with="type=${@dict.getType('mall_order_return_status')}">
                                <option value="">所有</option>
                                <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                            </select>
                        </li>-->
                        <li>
                            <label>联系人：</label>
                            <input type="text" name="orderLinkName"/>
                        </li>
                        <li>
                            <label>电话：</label>
                            <input type="text" name="orderLinkMobile"/>
                        </li>
                       <!-- <li>
                            <label>快递单号：</label>
                            <input type="text" name="expressNo"/>
                        </li>-->


                       <!-- <li>
                            <label>第三方支付成功后返回的订单号：</label>
                            <input type="text" name="tradeNo"/>
                        </li>-->

                        <li>
                            <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
                            <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
                        </li>
                    </ul>
                </div>
            </form>
        </div>

        <div class="btn-group-sm" id="toolbar" role="group">
            <!--<a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="system:mallOrder:add">
                <i class="fa fa-plus"></i> 添加
            </a>-->
            <a class="btn btn-primary single disabled" onclick="$.operate.editTab()" shiro:hasPermission="system:mallOrder:edit">
                <i class="fa fa-edit"></i> 修改
            </a>
            <!--<a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="system:mallOrder:remove">
                <i class="fa fa-remove"></i> 删除
            </a>-->
            <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="system:mallOrder:export">
                <i class="fa fa-download"></i> 导出
            </a>
        </div>
        <div class="col-sm-12 select-table table-striped">
            <table id="bootstrap-table"></table>
        </div>
    </div>
</div>
<th:block th:include="include :: footer" />
<script th:inline="javascript">
        var editFlag = [[${@permission.hasPermi('system:mallOrder:edit')}]];
        var removeFlag = [[${@permission.hasPermi('system:mallOrder:remove')}]];
        var orderStatusDatas = [[${@dict.getType('mall_order_status')}]];
        var payStatusDatas = [[${@dict.getType('number_yesno')}]];
        var returnStatusDatas = [[${@dict.getType('mall_order_return_status')}]];
        var prefix = ctx + "system/mallOrder";

        $(function() {
            var options = {
                url: prefix + "/list",
                createUrl: prefix + "/edit/-1",
                updateUrl: prefix + "/edit/{id}",
                removeUrl: prefix + "/remove",
                exportUrl: prefix + "/export",
                sortName: "createTime",
                sortOrder: "desc",
                modalName: "商城订单",
                columns: [{
                    checkbox: true
                },
                {
                    field: 'id',
                    title: '主键',
                    visible: false
                },
                {
                    field: 'nickname',
                    title: '用户'
                },
                {
                    field: 'orderNo',
                    title: '订单号'
                },
<!--                {-->
<!--                    field: 'payNo',-->
<!--                    title: '支付号'-->
<!--                },-->
<!--                {-->
<!--                    field: 'orderSum',-->
<!--                    title: '订单数量'-->
<!--                },-->

                {
                    field: 'orderAmount',
                    title: '订单总额'
                },
                {
                    field: 'payMoney',
                    title: '支付金额'
                },
                {
                    field: 'waitPayMoney',
                    title: '待付款金额'
                },
                {
                    field: 'orderStatus',
                    title: '订单状态',
                    formatter: function(value, row, index) {
                       return $.table.selectDictLabel(orderStatusDatas, value);
                    }
                },
<!--                {-->
<!--                    field: 'payStatus',-->
<!--                    title: '是否支付',-->
<!--                    formatter: function(value, row, index) {-->
<!--                       return $.table.selectDictLabel(payStatusDatas, value);-->
<!--                    }-->
<!--                },-->
<!--                {-->
<!--                    field: 'returnStatus',-->
<!--                    title: '退款状态',-->
<!--                    formatter: function(value, row, index) {-->
<!--                       return $.table.selectDictLabel(returnStatusDatas, value);-->
<!--                    }-->
<!--                },-->
                {
                    field: 'orderLinkName',
                    title: '联系人'
                },
                {
                    field: 'orderLinkMobile',
                    title: '电话'
                },
<!--                {-->
<!--                    field: 'orderlLinkAddress',-->
<!--                    title: '联系人地址'-->
<!--                },-->
<!--                {-->
<!--                    field: 'expressNo',-->
<!--                    title: '快递单号'-->
<!--                },-->
<!--                {-->
<!--                    field: 'expressName',-->
<!--                    title: '快递公司'-->
<!--                },-->
<!--                {-->
<!--                    field: 'remark',-->
<!--                    title: '备注'-->
<!--                },-->
<!--                {-->
<!--                    field: 'orderType',-->
<!--                    title: '订单类型1商品订单 2积分转换订单 3线下订单'-->
<!--                },-->
<!--                {-->
<!--                    field: 'img',-->
<!--                    title: '展示图片'-->
<!--                },-->
                {
                    field: 'tradeNo',
                    title: '第三方交易号'
                },
                {
                    field: 'payTime',
                    title: '支付时间'
                },
                {
                    field: 'useScoreSum',
                    title: '使用了多少积分'
                },
                {
                    title: '操作',
                    align: 'center',
                    formatter: function(value, row, index) {
                        var actions = [];
                        actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.editTab(\'' + row.id + '\')"><i class="fa fa-edit"></i>编辑</a> ');
                        //actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>删除</a>');
                        return actions.join('');
                    }
                }]
            };
            $.table.init(options);
        });
    </script>
</body>
</html>